from django.db import models
class user(models.Model):
    username=models.CharField(max_length=50)
    password=models.CharField(max_length=50)

class bumen(models.Model):
    bmname=models.CharField(max_length=50)
    sjbmid=models.ForeignKey('self',null=True,on_delete=models.SET_NULL,related_name='aa')
    cjtime=models.DateTimeField(auto_now=True)

class yuangong(models.Model):
    ygname=models.CharField(max_length=50)
    ygbm=models.ForeignKey(bumen,on_delete=models.CASCADE,related_name='zzd')
    price=models.DecimalField(max_digits=10,decimal_places=2)
    rztime=models.DateTimeField(auto_now=True)
    ygbh=models.CharField(max_length=50,unique=True)
    zhuangtai=models.BooleanField()

class kaoqin(models.Model):
    yuangongid=models.ForeignKey(yuangong,on_delete=models.CASCADE,related_name='zzd1')
    kqtime=models.DateTimeField(auto_now=True)
    kqleixing=models.CharField(max_length=50,choices=[(1,"正常"),(2,"迟到"),(3,"早退"),(4,"缺勤")])
    beizhu=models.CharField(max_length=50)
# Create your models here.
